<ui:composition template="baseTemplate.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="content">
		<h:form>

			<p:panelGrid columns="1" style="height:100%; width: 100%;">

				<f:facet name="header"> #{localization['previas.header']} </f:facet>

				<p:panelGrid columns="3"
					style="margin:15px auto; border: none !important;">
					<h:outputText value="#{localization['previas.selectOne']}" />
					<p:selectOneMenu value="#{previasMB.asignaturaId}">
						<f:selectItem
							itemLabel="-- #{localization['common.asignatura']} --"
							itemValue="" />
						<f:selectItems value="#{previasMB.asignaturas}" />
						<p:ajax update="tabla" listener="#{previasMB.buscarPrevias}" />
					</p:selectOneMenu>
				</p:panelGrid>

				<p:dataTable id="tabla" var="asignatura"
					value="#{previasMB.previas}" paginator="true" rows="10"
					paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					paginatorAlwaysVisible="false" paginatorPosition="bottom"
					style="margin:10px" emptyMessage="#{localization['misc.noRecordsFound']}">
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{localization['common.nombre']}" />
						</f:facet>
						<h:outputText value="#{asignatura.name}" />
					</p:column>
					<p:column style="text-align:center;">
						<f:facet name="header">
							<h:outputText value="#{localization['common.creditos']}" />
						</f:facet>
						<h:outputText value="#{asignatura.credits}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{localization['common.electiva']}" />
						</f:facet>
						<div style="margin:0 auto; text-align: center;">
							<h:selectBooleanCheckbox value="#{asignatura.isElectiva}" disabled="true" style="margin:0 auto;" />
						</div>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{localization['previas.aprobacion']}" />
						</f:facet>
						<h:outputText value="#{asignatura.tipoAprobacion}" disabled="true" />
					</p:column>
				</p:dataTable>
			</p:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>